Skip to main content

dragImage

Type

property

Summary

Reports the id of an image that should be used to represent the drag operation.

Syntax

set the dragImage to {empty | <imageID> }
get the dragImage

Description

The dragImage property specifies the id of an image used to represent a drag operation. The property is set by the source application in a dragStart handler.

The image is only looked up after completion of the dragStart handler in which it is set and so the image must persist for the lifetime of the operation. Typically, a control will want to use a pre-existing image object, or create a temporary object in dragStart that it deletes when it receives dragEnd.

LiveCode looks for the specified image in the following order:

  1. The stack of the current object's behavior (if applicable)
  2. The stack of the owner of the current object's behavior (if applicable) ...
  3. The stack of the current object's stack's behavior (if applicable)
  4. The current object's stack
  5. The current object's stack's mainstack (if a substack)
  6. The current object's stack's mainstacks substacks
  7. The list of open stacks, in order they were loaded

Examples

on dragStart
set the dragImage to the id of image "Drag Image" of me
end dragStart

message: dragStart, dragEnd

property: behavior, dragImageOffset

Compatibility and Support

Introduced

LiveCode 2.9

OS

mac

windows

Platforms

desktop

server

Thank you for your feedback!

Was this page helpful?